<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Directory Helper
 *
 * @package     VisualQ Local System
 * @author      CSU OJT Students '10 - '11
 * @copyright   Copyright (c) 2010 - 2011, Bitstop Network Services, Inc.
 * @version     0.1b January 09, 2011
 */

if( ! function_exists('check_directory'))
{
    function check_directory($dir,$filters)
    {
        $handle = opendir($dir);
        $files=array();
        if ($filters == "all"){while(($file = readdir($handle))!==false){$files[] = $file;}}
        if ($filters != "all")
        {
            $filters=explode(",",$filters);
            while (($file = readdir($handle))!==false)
            {
                for ($f=0;$f<sizeof($filters);$f++):
                    $system=explode(".",$file);
                    if ($system[1] == $filters[$f]){$files[] = $file;}
                endfor;
            }
        }
        closedir($handle);
        return $files;
    }
}

/* End of file directory_helper.php */
/* Location: ./system/application/controllers/directory_helper.php */